<template>
  <div class="filter-container">
    <div class="filter-item">
      <div class="filter-item-label">用户配送费配置</div>
      <div class="filter-item-content">
        <div class="filter-item-content-title">*基准价</div>
        <div class="filter-item-content-table">
          <table border="1" style="width: 100%; text-align: center; border-collapse: collapse">
            <tr style="font-size: 13px; color: white; background-color: #009688">
              <th style="padding: 10px 0; font-weight: 100" v-for="item in delivery.weight" :key="item.id">
                {{ item.minWeight }}-{{ item.maxWeight }}KG
              </th>
            </tr>
            <tr style="font-size: 13px; font-weight: 100">
              <td style="padding: 10px 0" v-for="item in delivery.weight" :key="item.id">
                <!-- <el-input v-model="item.deliveryFee" placeholder=""></el-input> -->
                <input
                  class="input-style"
                  style="text-align: center; border: 0; outline: none"
                  type="text"
                  v-model="item.deliveryFee"
                  placeholder="请输入"
                />
              </td>
            </tr>
          </table>
        </div>
        <div class="filter-item-content-btn" :v-model="delivery.status">
          <div><el-switch inactive-text="时段" :active-value="1" :inactive-value="2" v-model="delivery.status"></el-switch></div>
          <!-- <div><el-button type="primary">修改</el-button></div> -->
        </div>
        <div v-if="delivery.status == 1" class="filter-item-content-table">
          <table border="1" style="width: 100%; text-align: center; border-collapse: collapse">
            <tr style="font-size: 13px; color: white; background-color: #009688">
              <th style="padding: 10px 0; font-weight: 100" v-for="item in delivery.time" :key="item.id">
                {{ item.startTime }}-{{ item.endTime }}
              </th>
            </tr>
            <tr style="font-size: 13px; font-weight: 100">
              <td style="padding: 10px 0" v-for="item in delivery.time" :key="item.id">
                <!-- <el-input v-model="item.deliveryFee" placeholder=""></el-input> -->
                <input
                  class="input-style"
                  style="text-align: center; border: 0; outline: none"
                  type="text"
                  v-model="item.deliveryFee"
                  placeholder="请输入"
                />
              </td>
            </tr>
          </table>
        </div>
        <div class="filter-item-content-btn" :v-model="true">
          <div></div>
          <div class="shop-btn"><el-button type="primary" @click="updateDelivery">修改</el-button></div>
        </div>
      </div>
    </div>
    <div class="filter-item">
      <div class="filter-item-label">商户配送费配置</div>
      <div class="filter-item-content">
        <div class="filter-item-content-title">*基准价</div>
        <div class="filter-item-content-table">
          <table border="1" style="width: 100%; text-align: center; border-collapse: collapse">
            <tr style="font-size: 13px; color: white; background-color: #009688">
              <th style="padding: 10px 0; font-weight: 100" v-for="item in bussinse.weight" :key="item.id">
                {{ item.minWeight }}-{{ item.maxWeight }}KG
              </th>
            </tr>
            <tr style="font-size: 13px; font-weight: 100">
              <td style="padding: 10px 0" v-for="item in bussinse.weight" :key="item.id">
                <!-- <el-input v-model="item.deliveryFee" placeholder=""></el-input> -->
                <input
                  class="input-style"
                  style="text-align: center; border: 0; outline: none"
                  type="text"
                  v-model="item.deliveryFee"
                  placeholder="请输入"
                />
              </td>
            </tr>
          </table>
        </div>
        <div class="filter-item-content-btn" :v-model="delivery.status">
          <div><el-switch inactive-text="时段" :active-value="1" :inactive-value="2" v-model="bussinse.status"></el-switch></div>
          <!-- <div><el-button type="primary">修改</el-button></div> -->
        </div>
        <div v-if="bussinse.status == 1" class="filter-item-content-table">
          <table border="1" style="width: 100%; text-align: center; border-collapse: collapse">
            <tr style="font-size: 13px; color: white; background-color: #009688">
              <th style="padding: 10px 0; font-weight: 100" v-for="item in bussinse.time" :key="item.id">
                {{ item.startTime }}-{{ item.endTime }}
              </th>
            </tr>
            <tr style="font-size: 13px; font-weight: 100">
              <td style="padding: 10px 0" v-for="item in bussinse.time" :key="item.id">
                <!-- <el-input v-model="item.deliveryFee" placeholder=""></el-input> -->
                <input
                  class="input-style"
                  style="text-align: center; border: 0; outline: none"
                  type="text"
                  v-model="item.deliveryFee"
                  placeholder="请输入"
                />
              </td>
            </tr>
          </table>
        </div>
        <div class="filter-item-content-btn" :v-model="true">
          <div></div>
          <div class="shop-btn"><el-button type="primary" @click="updateBussinse">修改</el-button></div>
        </div>
      </div>
    </div>
    <div class="filter-item">
      <div class="filter-item-label">取货专员收益配置</div>
      <div class="filter-item-content">
        <div class="filter-item-content-input">
          <div class="des-input">
            <span>供应商</span>
            <el-input v-model="stationer.pickupSupplierPrice" placeholder="7"></el-input>
            <span>元</span>
            <span>中转仓</span>
            <el-input v-model="stationer.pickupWarehousePrice" placeholder="7"></el-input>
            <span>元</span>
            <el-button type="primary" @click="updateStationer">确定</el-button>
          </div>
        </div>
      </div>
    </div>
    <div class="filter-item">
      <div class="filter-item-label">配送员收益配置</div>
      <div class="filter-item-content">
        <div class="filter-item-content-more">
          <div class="more-title">销售订单的送件费用</div>
          <div>
            <span class="des">供应商配送费抽取配置</span>
            <div class="des-input">
              <span>供应商1</span>
              <el-input v-model="stationer.merchantDeliveryCost1" placeholder="7"></el-input>
              <span>元</span>
              <span>供应商2</span>
              <el-input v-model="stationer.merchantDeliveryCost2" placeholder="7"></el-input>
              <span>元</span>
              <span>供应商3</span>
              <el-input v-model="stationer.merchantDeliveryCost3" placeholder="7"></el-input>
              <span>元</span>
              <span>供应商4</span>
              <el-input v-model="stationer.merchantDeliveryCost4" placeholder="7"></el-input>
              <span>元</span>
            </div>
          </div>
          <div>
            <span class="des">用户配送费抽取配置</span>
            <div class="des-input">
              <span></span>
              <el-input v-model="stationer.custDeliveryCost" placeholder="7"></el-input>
              <span>元</span>
            </div>
          </div>
          <div class="more-title">售后订单的送件费用</div>
          <div>
            <span class="des">换货费用</span>
            <div class="des-input">
              <span>换货费用</span>
              <el-input v-model="stationer.exchangeGoodsCost" placeholder="7"></el-input>
              <span>元</span>
              <span>退货费用</span>
              <el-input v-model="stationer.returnGoodsCost" placeholder="7"></el-input>
              <span>元</span>
              <span>补货费用</span>
              <el-input v-model="stationer.replenishmentCost" placeholder="7"></el-input>
              <span>元</span>
            </div>
            <div class="only-btn">
              <el-button type="primary" @click="updateStationer">确定</el-button>
            </div>
          </div>
        </div>
      </div>
    </div>
    <div class="filter-item">
      <div class="filter-item-label">订单分拣员收益</div>
      <div class="filter-item-content">
        <div class="filter-item-content-input">
          <!-- <div>订单分拣员:每分拣一单</div> -->
          <span style="margin-right: 20px; font-size: 13px">订单分拣员:每分拣一单获得{{ stationer?.sortingProfit }}元收益</span>
          <div class="des-input">
            <el-input v-model="stationer.sortingProfit" placeholder="7"></el-input>
            <span>元</span>
            <el-button type="primary" @click="updateStationer">确定</el-button>
          </div>
        </div>
      </div>
    </div>
    <div class="filter-item">
      <div class="filter-item-label">
        增减项配置
        <el-icon
          ><Edit
            @click="addDeduction"
            style="width: 18px; height: 18px; font-size: 18px; color: #009688; vertical-align: middle; cursor: pointer"
        /></el-icon>
      </div>
      <div class="filter-item-content">
        <div class="hr-line"></div>
        <div class="form-container" style="margin-bottom: 10px">
          <el-form
            style="display: inline-block"
            inline
            :model="deductionSearch"
            ref="refDeduForm"
            class="form-line"
            label-width="70"
          >
            <el-form-item style="width: 180px; margin: 0" prop="roleId">
              <el-select size="small" @change="getDeduction" v-model="deductionSearch.roleId" placeholder="请选择岗位类型">
                <el-option
                  v-for="item in postList"
                  :key="item.roleId + '-' + item.roleName"
                  :label="item?.roleName"
                  :value="item.roleId as string"
                ></el-option>
              </el-select>
            </el-form-item>
          </el-form>
          <div style="display: inline-block; margin-left: 10px; vertical-align: middle" class="btn-container">
            <el-button type="primary" @click="handleResetDeduction(refDeduForm as FormInstance)" link size="small"
              >重置</el-button
            >
            <el-button type="primary" @click="getDeduction" link size="small">查询</el-button>
          </div>
        </div>
        <div class="filter-item-content-table">
          <div>
            <el-table
              border
              :cell-style="{ textAlign: 'center', fontSize: '13px' }"
              :header-cell-style="{
                textAlign: 'center',
                fontWeight: '100',
                fontSize: '13px',
                color: 'white',
                backgroundColor: '#009688'
              }"
              :data="deduction"
              style="width: 100%"
            >
              <el-table-column fixed prop="roleName" label="适用岗位" />
              <el-table-column fixed prop="subsidyName" label="项目名称" />
              <el-table-column fixed prop="subsidyValue" label="增减金额" />
              <el-table-column prop="clockingDemand" label="是否需要打卡">
                <template #default="scope">
                  {{ scope.row.clockingDemand === 1 ? "需要" : "无需" }}
                </template>
              </el-table-column>
              <el-table-column prop="createTime" label="添加时间" />
              <el-table-column fixed="right" label="操作">
                <template #default="scope">
                  <el-button link type="primary" size="small" @click="deleteDeduction(scope.row)">删除</el-button>
                  <el-button link type="primary" size="small" @click="selectDeduction(scope.row)">修改</el-button>
                </template>
              </el-table-column>
            </el-table>
          </div>
        </div>
      </div>
    </div>
    <div class="filter-item">
      <div class="filter-item-label">
        配送员补贴
        <el-icon
          ><Edit
            @click="addSubsidy"
            style="width: 18px; height: 18px; font-size: 18px; color: #009688; vertical-align: middle; cursor: pointer"
        /></el-icon>
      </div>
      <div class="filter-item-content">
        <div class="form-container" style="margin-bottom: 10px">
          <el-form
            style="display: inline-block"
            inline
            :model="subsidySearch"
            ref="refSubForm"
            class="form-line"
            label-width="70"
          >
            <el-form-item style="width: 180px; margin: 0" prop="roleId">
              <el-select size="small" @change="getSubsidy" v-model="subsidySearch.roleId" placeholder="请选择岗位类型">
                <el-option
                  v-for="item in postList"
                  :key="item.roleId + '-' + item.roleName"
                  :label="item?.roleName"
                  :value="item.roleId as string"
                ></el-option>
              </el-select>
            </el-form-item>
          </el-form>
          <div style="display: inline-block; margin-left: 10px; vertical-align: middle" class="btn-container">
            <el-button type="primary" @click="handleResetSubsidy(refSubForm as FormInstance)" link size="small">重置</el-button>
            <el-button type="primary" @click="getSubsidy" link size="small">查询</el-button>
          </div>
        </div>
        <div v-for="(item, index) in subsidy" :key="index" class="filter-item-content-list">
          <p>
            <span>配送收益大于{{ item.revenue }}，补贴{{ item.subsidyValue }}元的补贴</span
            ><el-button type="text" class="delete-btn" @click="btnRemoveSubsidy(item)">删除</el-button
            ><el-button type="text" @click="editSubsidy(item)">修改</el-button>
          </p>
        </div>
      </div>
    </div>
    <el-dialog title="增减项配置" v-model="dialogVisible" width="500" @close="radio = ''">
      <el-form :model="deductionForm" :rules="deductionFormRules" ref="refDeductionForm" label-width="80px">
        <el-form-item label="适用岗位" prop="roleId">
          <el-select v-model="deductionForm.roleId" placeholder="请选择">
            <el-option
              v-for="item in postList"
              :key="item.roleId + '-' + item.roleName"
              :label="item?.roleName"
              :value="item.roleId as string"
            ></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="项目名称" prop="subsidyName">
          <el-input v-model="deductionForm.subsidyName" placeholder="请输入项目名称"></el-input>
        </el-form-item>
        <el-form-item label="增减方式" prop="subsidyType">
          <el-select v-model="deductionForm.subsidyType" placeholder="请选择">
            <el-option label="增加" value="1"></el-option>
            <el-option label="减扣" value="2"></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="扣减金额" prop="subsidyValue">
          <el-input v-model="deductionForm.subsidyValue" placeholder="元/天"></el-input>
        </el-form-item>
        <el-form-item label="打卡需求" prop="clockingDemand">
          <el-select v-model="deductionForm.clockingDemand" placeholder="请选择">
            <el-option label="需要打卡" :value="1"></el-option>
            <el-option label="无需打卡" :value="2"></el-option>
          </el-select>
        </el-form-item>
      </el-form>
      <template #footer>
        <div class="dialog-footer">
          <el-button type="primary" @click="submitDeduction(refDeductionForm as FormInstance)">确定</el-button>
          <el-button type="primary" @click="cancleDeduction(refDeductionForm as FormInstance)">取消</el-button>
        </div>
      </template>
    </el-dialog>

    <el-dialog title="补贴配置" v-model="dialogVisible2" width="500">
      <el-form :model="subsidyForm" :rules="subsidyFormRules" ref="refSubsidyForm" label-width="80px">
        <el-form-item label="适用岗位" prop="roleId">
          <el-select v-model="subsidyForm.roleId" placeholder="请选择">
            <el-option
              v-for="item in postList"
              :key="item.roleId + '-' + item.roleName"
              :label="item?.roleName"
              :value="item.roleId as string"
            ></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="配送收益" prop="revenue">
          <el-input v-model="subsidyForm.revenue" placeholder="元/月"></el-input>
        </el-form-item>
        <el-form-item label="补贴金额" prop="subsidyValue">
          <el-input v-model="subsidyForm.subsidyValue" placeholder="元"></el-input>
        </el-form-item>
      </el-form>
      <template #footer>
        <div class="dialog-footer">
          <el-button type="primary" @click="submitSubsidy(refSubsidyForm as FormInstance)">确定</el-button>
          <el-button type="primary" @click="dialogVisible2 = false">取消</el-button>
        </div>
      </template>
    </el-dialog>
  </div>
</template>

<script lang="tsx" setup name="CostConfig">
import { Cost } from "@/api/interface/province/config";
import { Edit } from "@element-plus/icons-vue";
import {
  deleteCostDeductionAPI,
  deleteCostSubsidyAPI,
  getCostDeductionAPI,
  getCostDeliverAPI,
  getCostStationerAPI,
  getCostSubsidyAPI,
  updateCostDeductionAPI,
  updateCostDeliverAPI,
  updateCostStationerAPI,
  updateCostSubsidyAPI
} from "@/api/modules/province/configAPI";
import { ElMessage, ElMessageBox, FormInstance, FormRules } from "element-plus";
import { onMounted, ref } from "vue";
import { getPostListAPI } from "@/api/modules/province/organizMangeAPI";
import { Post } from "@/api/interface/province/organizationManage";
let dialogVisible = ref<boolean>(false);
let dialogVisible2 = ref<boolean>(false);
const delivery = ref<Cost.DeliverData>({
  weight: [],
  time: [],
  status: 1
});
const radio = ref<string>("");
const deliveryForm = ref<Cost.AddParams>({
  weight: [],
  time: [],
  status: 1,
  userType: 1
});
const bussinse = ref<Cost.DeliverData>({
  weight: [
    {
      id: 1,
      userType: -2147483648,
      minWeight: 0,
      maxWeight: 5,
      deliveryFee: 0
    },
    {
      id: 2,
      userType: -2147483648,
      minWeight: 5,
      maxWeight: 10,
      deliveryFee: 0
    }
  ],
  time: [
    {
      id: 1,
      status: -2147483648,
      userType: -2147483648,
      startTime: "14:15:22.123Z",
      endTime: "14:15:22.123Z",
      deliveryFee: 0
    },
    {
      id: 2,
      status: -2147483648,
      userType: -2147483648,
      startTime: "14:15:22.123Z",
      endTime: "14:15:22.123Z",
      deliveryFee: 0
    }
  ],
  status: 1
});
const stationer = ref<Cost.StationerData>({
  id: 1,
  commodityCost: 0,
  residueDeliveryCost: 0,
  custDeliveryCost: 0,
  merchantDeliveryCost1: 0,
  merchantDeliveryCost2: 0,
  merchantDeliveryCost3: 0,
  merchantDeliveryCost4: 0,
  exchangeGoodsCost: 0,
  returnGoodsCost: 0,
  replenishmentCost: 0
});
const deduction = ref<Cost.DedData[]>([]);
const deductionForm = ref<Cost.DedData>({
  id: 1,
  status: 1,
  subsidyName: "",
  subsidyType: "",
  roleId: ""
  // subsidyValue: 0,
  // clockingDemand: 1
});
const deductionFormRules = ref<FormRules>({
  roleId: [{ required: true, message: "请选择适用岗位", trigger: "blur" }],
  subsidyName: [{ required: true, message: "请输入项目名称", trigger: "blur" }],
  subsidyValue: [{ required: true, message: "请输入扣减金额", trigger: "blur" }],
  clockingDemand: [{ required: true, message: "请选择打卡需求", trigger: "blur" }],
  subsidyType: [{ required: true, message: "请选择增减方式", trigger: "blur" }]
});
const refDeductionForm = ref<FormInstance>();
const subsidy = ref<Cost.SubsidyData[]>([]);
const subsidyForm = ref<Cost.SubsidyData>({});
const refSubsidyForm = ref<FormInstance>();
const subsidyFormRules = ref<FormRules>({
  roleId: [{ required: true, message: "请选择适用岗位", trigger: "blur" }],
  revenue: [{ required: true, message: "请输入收益金额", trigger: "blur" }],
  subsidyValue: [{ required: true, message: "请输入补贴金额", trigger: "blur" }]
});
const btnRemoveSubsidy = (item: Cost.SubsidyData) => {
  ElMessageBox.confirm("此操作将永久删除该补贴项【" + item.revenue + "】元, 是否继续?", "提示", {
    confirmButtonText: "确定",
    cancelButtonText: "取消",
    type: "warning"
  })
    .then(() => {
      deleteCostSubsidy(String(item.id));
    })
    .catch(() => {
      ElMessage.info("已取消删除");
    });
};
const deleteCostSubsidy = async (id: string) => {
  const { code, msg } = await deleteCostSubsidyAPI({ id });
  if (code == "200") {
    ElMessage.success("删除成功");
    getSubsidy();
  } else {
    ElMessage.error(msg);
  }
};
const addSubsidy = () => {
  subsidyForm.value = {
    revenue: 0,
    subsidyValue: 0
  };
  dialogVisible2.value = true;
};
const editSubsidy = (item: Cost.SubsidyData) => {
  subsidyForm.value = item;
  dialogVisible2.value = true;
};
const submitSubsidy = (formEl: FormInstance) => {
  formEl.validate(valid => {
    if (valid) {
      updateSubsidy();
    } else {
      ElMessage.error("请填写正确的信息!");
    }
  });
};
const selectDeduction = (item: Cost.DedData) => {
  deductionForm.value = item;
  dialogVisible.value = true;
};
const deleteDeduction = (item: Cost.DedData) => {
  ElMessageBox.confirm("此操作将永久删除该扣减项【" + item.subsidyName + "】的配置, 是否继续?", "提示", {
    confirmButtonText: "确定",
    cancelButtonText: "取消",
    type: "warning"
  })
    .then(() => {
      delDeduction(String(item.id));
    })
    .catch(() => {
      ElMessage.info("已取消删除");
    });
};
const delDeduction = async (id: string) => {
  const { code, msg } = await deleteCostDeductionAPI({ id });
  if (code == "200") {
    ElMessage.success("删除成功");
    getDeduction();
  } else {
    ElMessage.error(msg);
  }
};
const addDeduction = () => {
  deductionForm.value = {
    status: 1,
    subsidyName: "",
    subsidyType: ""
    // subsidyValue: 0,
    // clockingDemand: 1
  };
  dialogVisible.value = true;
};
const getDelivery = async (userType: number) => {
  const { data, code, msg } = await getCostDeliverAPI({ userType });
  console.log(code);
  if (code == "200" && data) {
    if (userType === 1) {
      delivery.value = data;
    } else if (userType === 2) {
      bussinse.value = data;
    }
  } else {
    ElMessage.error(msg);
  }
};
const updateDelivery = async () => {
  deliveryForm.value.userType = 1;
  delivery.value.weight.forEach(item => {
    deliveryForm.value.weight.push({
      id: item.id,
      deliveryFee: item.deliveryFee as number
    });
  });
  delivery.value.time.forEach(item => {
    deliveryForm.value.time.push({
      id: item.id,
      deliveryFee: item.deliveryFee as number
    });
  });
  const { code, msg } = await updateCostDeliverAPI(deliveryForm.value);
  if (code == "200") {
    ElMessage.success("修改成功");
    getDelivery(1);
  } else {
    ElMessage.error(msg);
  }
};
const updateBussinse = async () => {
  const { code, msg } = await updateCostDeliverAPI(deliveryForm.value);
  if (code == "200") {
    ElMessage.success("修改成功");
    getDelivery(2);
  } else {
    ElMessage.error(msg);
  }
};
const getStationer = async () => {
  const { data, code, msg } = await getCostStationerAPI();
  if (code == "200" && data) {
    stationer.value = data;
  } else {
    ElMessage.error(msg);
  }
};
const updateStationer = async () => {
  const { code, msg } = await updateCostStationerAPI(stationer.value);
  if (code == "200") {
    ElMessage.success("修改成功");
    getStationer();
  } else {
    ElMessage.error(msg);
  }
};
const deductionSearch = ref<{
  roleId: string;
}>({
  roleId: ""
});
const refDeduForm = ref<FormInstance>();
const handleResetDeduction = (formEl: FormInstance) => {
  formEl.resetFields();
  getDeduction();
};
const getDeduction = async () => {
  const { code, data, msg } = await getCostDeductionAPI(deductionSearch.value);
  if (code == "200" && data) {
    deduction.value = data;
  } else {
    ElMessage.error(msg);
  }
};
const updateDeduction = async () => {
  const { code, msg } = await updateCostDeductionAPI(deductionForm.value);
  if (code == "200") {
    ElMessage.success(msg);
    getDeduction();
  } else {
    ElMessage.error(msg);
  }
};
const submitDeduction = (formEl: FormInstance) => {
  formEl.validate(valid => {
    if (valid) {
      if (deductionForm.value.id) {
        deduction.value.splice(deduction.value.indexOf(deductionForm.value), 1, deductionForm.value);
      } else {
        deduction.value.push(deductionForm.value);
      }
      console.log(deduction.value);
      updateDeduction();
      dialogVisible.value = false;
    } else {
      ElMessage.error("请检查输入项");
    }
  });
};
const subsidySearch = ref<{
  roleId: string;
}>({
  roleId: ""
});
const refSubForm = ref<FormInstance>();
const handleResetSubsidy = (formEl: FormInstance) => {
  formEl.resetFields();
  getSubsidy();
};
const getSubsidy = async () => {
  const { code, data, msg } = await getCostSubsidyAPI(subsidySearch.value);
  if (code == "200" && data) {
    subsidy.value = data;
  } else {
    ElMessage.error(msg);
  }
};
const updateSubsidy = async () => {
  const { code, msg } = await updateCostSubsidyAPI(subsidyForm.value);
  if (code == "200") {
    ElMessage.success("操作成功");
    getSubsidy();
    dialogVisible2.value = false;
  } else {
    ElMessage.error(msg);
  }
};
const cancleDeduction = (formEl: FormInstance) => {
  formEl.resetFields();
  dialogVisible.value = false;
};
let postList = ref<Post.PostList[]>([]);
const getPost = async () => {
  const { code, rows, total } = await getPostListAPI({
    /**
     * 公司类型1-省级公司 2-市级公司
     */
    companyType: "",
    /**
     * 页数
     */
    pageNum: 1,
    /**
     * 每页数量
     */
    pageSize: 100,
    /**
     * 该用户的省份
     */
    province: JSON.parse(localStorage.getItem("userInfo") as string).province,
    /**
     * 岗位名称
     */
    roleName: ""
  });
  if (code == "200" && rows && total) {
    postList.value = rows;
  }
};
onMounted(() => {
  getDelivery(1);
  getDelivery(2);
  getStationer();
  getDeduction();
  getSubsidy();
  getPost();
});
</script>

<style lang="scss" scoped>
::v-deep .el-input--suffix .el-input__inner {
  padding-right: 15px;
}
::v-deep .el-form-item__label {
  font-size: 13px;
  font-weight: 100;
  color: black;
}
::v-deep .el-button > span {
  font-size: 12px;
}
::v-deep .el-input__inner {
  font-size: 13px;
}

// ::v-deep .el-input {
//   display: inline;
// }
.filter-container {
  box-sizing: border-box;
  padding: 15px;
  background-color: white;
}
.filter-item {
  width: 100%;
  .filter-item-label {
    padding: 10px 0;
    font-size: 14px;
    font-weight: bold;
  }
  .filter-item-content {
    width: 100%;
    padding: 15px 10px;
    border: 1px solid #e2e2e2;

    // text-align: right;
    .filter-item-content-list {
      padding: 0 !important;
      margin: 0 !important;
      border: 1px solid transparent;
      p {
        display: inline-block;
        padding: 0 5px;
        margin: 5px 0;
        background: whitesmoke;
        .delete-btn {
          color: red;
        }
        span {
          margin-right: 200px;
          font-size: 13px;
        }
      }
    }
    .hr-line {
      margin-bottom: 10px;
      .radio-btn {
        position: relative;
        display: inline-block;
        margin-right: 40px;
        background: whitesmoke;
        span {
          position: absolute;
          top: -8px;
          right: -8px;
          z-index: 1;
          display: inline-block;
          width: 16px;
          height: 16px;
          font-size: 12px;
          line-height: 14px;
          color: white;
          text-align: center;
          cursor: pointer;
          background-color: red;
          border-radius: 100%;
        }
        ::v-deep .el-radio-button__inner {
          width: 100px;
          padding: 13px 20px;
          font-size: 12px;
          background: lightgray;
        }
      }
    }
    .filter-item-content-title {
      margin-bottom: 10px;
    }
    .filter-item-content-btn {
      margin-top: 10px;
      div:nth-child(1) {
        margin-bottom: 10px;
      }
      div:nth-child(2) {
        display: inline-block;
        float: right;
        margin-top: -20px;
      }
      .shop-btn {
        display: block !important;
        float: none !important;
        padding-top: 15px;
        margin-top: 10px !important;
        text-align: right;
      }
    }
    .filter-item-content-input {
      text-align: right;
      .des-input {
        display: inline-block;
        ::v-deep .el-input {
          display: inline;
        }
        span {
          display: inline-block;
          margin: 0 10px;
          font-size: 13px;
        }
      }
    }
    .filter-item-content-more {
      text-align: left;
      .more-title {
        margin: 10px 0;
        font-size: 14px;
        font-weight: bold;
      }
      .des {
        font-size: 13px;

        // color: gray;
        vertical-align: middle;
      }
      .des-input {
        display: inline-block;
        padding: 6px 0;
        span {
          display: inline-block;
          margin: 0 10px;
          font-size: 13px;
        }
      }
      ::v-deep .el-input {
        width: 75px;
      }
      .only-btn {
        // display: block;
        display: inline-block;
        float: right;
        margin-top: -3px;
      }
    }
  }
}
</style>
